xen: Remove some initialised but otherwise unused variables.
authorOlaf Hering <olaf@aepfle.de>
Fri, 20 May 2011 08:33:53 +0000 (09:33 +0100)
committerOlaf Hering <olaf@aepfle.de>
Fri, 20 May 2011 08:33:53 +0000 (09:33 +0100)
Fixes the build under gcc-4.6 -Werror=unused-but-set-variable

Signed-off-by: Olaf Hering <olaf@aepfle.de>
xen/arch/x86/cpu/amd.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/microcode_amd.c
xen/arch/x86/mm/mem_sharing.c
xen/arch/x86/msi.c
xen/arch/x86/x86_64/mm.c
xen/common/grant_table.c
xen/common/sched_credit2.c
xen/drivers/passthrough/vtd/intremap.c

index 3fa15ccb60cf56ada1eda1be46dc1421c861ee9d..f9e5bea0ce11ab805ef1c08d8f0e34dc48165807 100644 (file)
@@ -329,7 +329,6 @@ static void check_syscfg_dram_mod_en(void)
 static void __devinit init_amd(struct cpuinfo_x86 *c)
 {
        u32 l, h;
-       int r;
 
 #ifdef CONFIG_SMP
        unsigned long long value;
@@ -375,8 +374,6 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
        }
 #endif
 
-       r = get_model_name(c);
-
        switch(c->x86)
        {
        case 6: /* An Athlon/Duron */
index 8e1c970de8315a513ea52d02bd2e475b0963dba7..5b161a4ec8b16bcb15498570811090c162c2cca4 100644 (file)
@@ -33,8 +33,6 @@ struct movsl_mask movsl_mask __read_mostly;
  */
 static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
 {
-       const char *extra = "";
-
        if (!~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx &
               opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx))
                return;
@@ -51,7 +49,6 @@ static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
                      opt_cpuid_mask_edx);
                if (!~(opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx))
                        return;
-               extra = "extended ";
                break;
 /* 
  * CPU supports this feature if the processor signature meets the following:
index 3e61ee389adfe60b899271264d213622f25b6ced..909085b0c9386531724559e25d8f8b4f1f0e43ed 100644 (file)
@@ -162,19 +162,19 @@ void mce_need_clearbank_register(mce_need_clearbank_t cbfunc)
     mc_need_clearbank_scan = cbfunc;
 }
 
-static struct mcinfo_bank *mca_init_bank(enum mca_source who,
+static void mca_init_bank(enum mca_source who,
                                          struct mc_info *mi, int bank)
 {
     struct mcinfo_bank *mib;
 
     if (!mi)
-        return NULL;
+        return;
 
     mib = x86_mcinfo_reserve(mi, sizeof(struct mcinfo_bank));
     if (!mib)
     {
         mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
-        return NULL;
+        return;
     }
 
     memset(mib, 0, sizeof (struct mcinfo_bank));
@@ -207,8 +207,6 @@ static struct mcinfo_bank *mca_init_bank(enum mca_source who,
         mib->mc_ctrl2 = mca_rdmsr(MSR_IA32_MC0_CTL2 + bank);
         rdtscll(mib->mc_tsc);
     }
-
-    return mib;
 }
 
 static int mca_init_global(uint32_t flags, struct mcinfo_global *mig)
@@ -297,8 +295,6 @@ mctelem_cookie_t mcheck_mca_logout(enum mca_source who, struct mca_banks *bankma
     recover = (mc_recoverable_scan)? 1: 0;
 
     for (i = 0; i < nr_mce_banks; i++) {
-        struct mcinfo_bank *mib;  /* on stack */
-
         /* Skip bank if corresponding bit in bankmask is clear */
         if (!mcabanks_test(i, bankmask))
             continue;
@@ -353,7 +349,7 @@ mctelem_cookie_t mcheck_mca_logout(enum mca_source who, struct mca_banks *bankma
              */
             recover = mc_recoverable_scan(status);
 
-        mib = mca_init_bank(who, mci, i);
+        mca_init_bank(who, mci, i);
 
         if (mc_callback_bank_extended)
             mc_callback_bank_extended(mci, i, status);
@@ -1226,13 +1222,10 @@ static void x86_mc_msrinject(void *data)
 {
     struct xen_mc_msrinject *mci = data;
     struct mcinfo_msr *msr;
-    struct cpuinfo_x86 *c;
     uint64_t hwcr = 0;
     int intpose;
     int i;
 
-    c = &cpu_data[smp_processor_id()];
-
     if (mci->mcinj_flags & _MC_MSRINJ_F_REQ_HWCR_WREN)
         hwcr = x86_mc_hwcr_wren();
 
index f90334439a5f31d690d58fefc2b9b263694e4fef..e1b495fc773daf407345026ece5540986c23faa6 100644 (file)
@@ -164,7 +164,6 @@ static int apply_microcode(int cpu)
 static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
                                          size_t size, unsigned long *offset)
 {
-    struct microcode_header_amd *mc_header;
     size_t total_size;
     const uint8_t *bufp = buf;
     unsigned long off;
@@ -182,8 +181,6 @@ static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
         return -EINVAL;
     }
 
-    mc_header = (struct microcode_header_amd *)(&bufp[off+8]);
-
     total_size = (unsigned long) (bufp[off+4] + (bufp[off+5] << 8));
 
     printk(KERN_INFO "microcode: size %lu, total_size %lu, offset %ld\n",
index c8a73120b645f591a08e3f473cfc9cbe42ee8ae8..5cf50c60ffe25e913491a68ddf4a97f958a5ac11 100644 (file)
@@ -376,10 +376,8 @@ int mem_sharing_debug_gfn(struct domain *d, unsigned long gfn)
 {
     p2m_type_t p2mt;
     mfn_t mfn;
-    struct page_info *page;
 
     mfn = gfn_to_mfn(p2m_get_hostp2m(d), gfn, &p2mt);
-    page = mfn_to_page(mfn);
 
     printk("Debug for domain=%d, gfn=%lx, ", 
             d->domain_id, 
index 9ea4f87879e4440baf4d1b64daca7e578ff7a592..6b0d41ef8d060d936c99da4b697f1d8a3972dcd3 100644 (file)
@@ -745,17 +745,8 @@ static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
 static void __pci_disable_msi(struct msi_desc *entry)
 {
     struct pci_dev *dev;
-    int pos;
-    u16 control;
-    u8 bus, slot, func;
 
     dev = entry->dev;
-    bus = dev->bus;
-    slot = PCI_SLOT(dev->devfn);
-    func = PCI_FUNC(dev->devfn);
-
-    pos = pci_find_cap_offset(bus, slot, func, PCI_CAP_ID_MSI);
-    control = pci_conf_read16(bus, slot, func, msi_control_reg(pos));
     msi_set_enable(dev, 0);
 
     BUG_ON(list_empty(&dev->msi_list));
index 58f014138232dfbbd7ad4c24a2ff5a964dd09489..3d7a8bcba2719e0bd5016ca67b93260e1714f3f9 100644 (file)
@@ -437,7 +437,7 @@ void destroy_m2p_mapping(struct mem_hotadd_info *info)
 static int setup_compat_m2p_table(struct mem_hotadd_info *info)
 {
     unsigned long i, va, smap, emap, rwva, epfn = info->epfn;
-    unsigned int n, memflags;
+    unsigned int n;
     l3_pgentry_t *l3_ro_mpt = NULL;
     l2_pgentry_t *l2_ro_mpt = NULL;
     struct page_info *l1_pg;
@@ -489,8 +489,6 @@ static int setup_compat_m2p_table(struct mem_hotadd_info *info)
         if ( n == CNT )
             continue;
 
-        memflags = MEMF_node(phys_to_nid(i << PAGE_SHIFT));
-
         l1_pg = mfn_to_page(alloc_hotadd_mfn(info));
         err = map_pages_to_xen(rwva, page_to_mfn(l1_pg),
                                1UL << PAGETABLE_ORDER,
index 1c5f52ee3ae457a3de851c65deb423c5cdf0a41d..7090dfb5c48c248bf369c63dff61068cc77964f8 100644 (file)
@@ -765,7 +765,6 @@ __gnttab_unmap_common(
     struct domain   *ld, *rd;
     struct active_grant_entry *act;
     s16              rc = 0;
-    u32              old_pin;
 
     ld = current->domain;
 
@@ -811,7 +810,6 @@ __gnttab_unmap_common(
     spin_lock(&rd->grant_table->lock);
 
     act = &active_entry(rd->grant_table, op->map->ref);
-    old_pin = act->pin;
 
     if ( op->frame == 0 )
     {
index 517ec8c49c90d8d93d9c53a60124d3e285eb2a50..116cd77a14428746b9bbd4659787108821e28147 100644 (file)
@@ -1880,7 +1880,7 @@ static void deactivate_runqueue(struct csched_private *prv, int rqi)
 
 static void init_pcpu(const struct scheduler *ops, int cpu)
 {
-    int rqi, old_rqi, flags;
+    int rqi, flags;
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_runqueue_data *rqd;
     spinlock_t *old_lock;
@@ -1894,8 +1894,6 @@ static void init_pcpu(const struct scheduler *ops, int cpu)
         return;
     }
 
-    old_rqi = prv->runq_map[cpu];
-
     /* Figure out which runqueue to put it in */
     rqi = 0;
 
index 36a8f7b0dc09ef83b053b5e2bc6f4a6eb327ed6e..f3cbe0c0a6bd72a025694e9f7d0ffecdd6d3152d 100644 (file)
@@ -367,7 +367,6 @@ unsigned int io_apic_read_remap_rte(
     unsigned int ioapic_pin = (reg - 0x10) / 2;
     int index;
     struct IO_xAPIC_route_entry old_rte = { 0 };
-    struct IO_APIC_route_remap_entry *remap_rte;
     int rte_upper = (reg & 1) ? 1 : 0;
     struct iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
@@ -389,8 +388,6 @@ unsigned int io_apic_read_remap_rte(
     *IO_APIC_BASE(apic) = reg + 1;
     *(((u32 *)&old_rte) + 1) = *(IO_APIC_BASE(apic)+4);
 
-    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
-
     if ( remap_entry_to_ioapic_rte(iommu, index, &old_rte) )
     {
         *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg;
@@ -850,10 +847,7 @@ int iommu_enable_x2apic_IR(void)
 
     for_each_drhd_unit ( drhd )
     {
-        struct qi_ctrl *qi_ctrl = NULL;
-
         iommu = drhd->iommu;
-        qi_ctrl = iommu_qi_ctrl(iommu);
 
         /* Clear previous faults */
         clear_fault_bits(iommu);